export enum AndOr {
  And,
  Or,
  Not
}

export enum Compare {
  Contains,
  NotContains,
  Equal,
  NotEqual,
  GreaterThan,
  LessThan,
  GreaterThanOrEqual,
  LessThanOrEqual
}

export class ExpressionPair {
  public constructor(
    public PropertyName: string,
    public propertyValue: any,
    public compare: Compare,
    public andOr: AndOr) {
  }
}

export class PagerSearchInput {
  public constructor(
    public CurrentPageIndex: number,
    public PageSize: number,
    public ExpressionPairs: Array<ExpressionPair> = new Array<ExpressionPair>(),
    public SortExpressions: Array<SortExpression> = new Array<SortExpression>()) {
  }
}

export class SonPagerSearchInput {
  public constructor(
    public pId: any,
    public CurrentPageIndex: number,
    public PageSize: number,
    public ExpressionPairs: Array<ExpressionPair> = new Array<ExpressionPair>(),
    public SortExpressions: Array<SortExpression> = new Array<SortExpression>()) {
  }
}

export class PagedResultDto<T> {
  public constructor(
    public recordTotalCount: number,
    public pageTotalCount: number,
    public currentPageIndex: number,
    public pageSize: number,
    public entities: Array<T> = new Array<T>()) {
  }
}

export class SystemFormControl {
  constructor(
    public fieldName: string,
    public fieldCaption: string,
    public fieldType: FieldType,
    public isRequired: boolean,
    public maxLength: number,
    public minLength: number,
    public remoteValid: string,
    public remoteData: string,
    public isSearchField: boolean,
    public fieldData: Array<KeyValueOutput> = new Array<KeyValueOutput>(),
    public loadRemoteDataType: LoadRemoteDataType,
    public showInForm: boolean = true,
    public showInTable: boolean = true,
    public canSortable = false,

    public inputColIndex = 0,
    public inputColSpan = 0,
    public inputRowIndex = 0,
    public inputRowSpan = 0,
    public labelColSpan = 0,
    public labelRowIndex = 0,
    public labelRowSpan = 0,
    public lableColIndex = 0,
  ) {

  }
}


export class DrillFormControl {
  labelSet: any;
  constructor(
    public fieldName: string,
    public fieldCaption: string,
    public fieldType: FieldType,
    public isRequired: boolean,
    public maxLength: number,
    public minLength: number,
    public remoteValid: string,
    public remoteData: string,
    public isSearchField: boolean,
    public fieldData: Array<KeyValueOutput> = new Array<KeyValueOutput>(),
    public loadRemoteDataType: LoadRemoteDataType,
    public showInForm: boolean = true,
    public showInTable: boolean = true,
    public canSortable = false,
    public labelRowIndex = 0,
    public lableColIndex = 0,
    public labelRowSpan = 0,
    public labelColSpan = 0,
    public inputRowIndex = 0,
    public inputColIndex = 0,
    public inputRowSpan = 0,
    public inputColSpan = 0,
    public inputSet = 0,
    public BackgroundImage = '',
    public BackgroundCorlor = '',
    public BannerImage = '',
    public BottomImage = ''
  ) {

  }
}


export class ContentTableSet {
  constructor(
    public rowIndex = 0,
    public colIndex = 0,
    public rowSpan = 0,
    public colSpan = 0,
  ) {

  }
}


export class ArSystemFormControl {
  constructor(
    public SystemFormControls: Array<SystemFormControl>
  ) {
  }

}

export class KeyValueOutput {
  constructor(
    public caption: string,
    public dValue: any) {

  }
}

export enum FieldType {
  Text,
  RichText,
  MultipleText,
  CheckBox,
  Radio,
  Select,
  Number,
  Toggle,
  Datetime,
  Password,
  Image,
  Upload,
  Label,
  Color
}

export enum ElementViewType {
  List,
  Add,
  Edit
}

export enum LoadRemoteDataType {
  LoadAll,
  Filter,
}

export interface IChechOperation {
  IsChecked: boolean;
}

export enum SortType {
  Asc,
  Desc,
  Null
}

export class SortExpression {
  constructor(
    public PropertyName: string = '',
    public sortType: SortType = null
  ) {
  }
}

export class SearchValue {
  constructor(
    public value: string,
    public url: string,
  ) { }
}

export class SearchBarSet {
  constructor(
    public provinceName = new ExpressionPair('provinceName', '', Compare.Equal, AndOr.And),
    public cityName = new ExpressionPair('cityName', '', Compare.Equal, AndOr.And),
    public school = new ExpressionPair('school', '', Compare.Equal, AndOr.And),
    public academe = new ExpressionPair('academe', '', Compare.Equal, AndOr.And),
    public department = new ExpressionPair('department', '', Compare.Equal, AndOr.And),
    public searchText = new ExpressionPair('searchText', '', Compare.Contains, AndOr.And),
  ) { }
}
export class SearchBarSetadmin {
  constructor(

    public departmentadmin = new ExpressionPair('department', '', Compare.Equal, AndOr.And),
    public searchTextadmin = new ExpressionPair('searchText', '', Compare.Contains, AndOr.And),
  ) { }
}
